local skill = fk.CreateSkill{
  name = "tea__sheniang",
}
---@type FilterSpec
local sheniang = {
  frequency = Skill.Compulsory,
  mute = true,
  card_filter = function(self, card, player)
    if not player:hasSkill(skill.name) then return end
    local round_count = Fk:currentRoom():getBanner("RoundCount") or 0
    if player.hp > round_count then
      return table.contains(player:getCardIds("h"), card.id) and card.trueName == "analeptic"
    elseif player.hp < round_count then
      return table.contains(player:getCardIds("h"), card.id) and card.trueName == "peach"
    end
  end,
  view_as = function(self, player, card)
    local round_count = Fk:currentRoom():getBanner("RoundCount")
    if player.hp > round_count then
      local c = Fk:cloneCard("peach", card.suit, card.number)
      c.skillName = skill.name
      return c
    elseif player.hp < round_count then
      local c = Fk:cloneCard("analeptic", card.suit, card.number)
      c.skillName = skill.name
      return c
    end
  end,
}
---@type TrigSkelSpec<TrigFunc>
local sheniang_trigger = {
  can_refresh = function(self, event, target, player, data)
    return target == player and table.contains(data.card.skillNames or {}, skill.name)
  end,
  on_refresh = function(self, event, target, player, data)
    player.room:notifySkillInvoked(player, skill.name, "special")
    if data.card.trueName == "peach" then
      player:broadcastSkillInvoke(skill.name, 1)
    else
      player:broadcastSkillInvoke(skill.name, 2)
    end
  end,
}
skill:addEffect("filter", sheniang)
skill:addEffect(fk.PreCardUse, sheniang_trigger)
return skill